package com.idea.cery.springboot1.base;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

/**
 * @Author:cery
 * @Version 1.0
 * @Date:2020/4/17
 */
@Component
public class MqConsumer {


    @JmsListener(destination = "${spring.activemq.queue-name}")
    public void receiveMsg(String text) {
        System.out.println("queue: " + text);
    }

    @JmsListener(destination = "${spring.activemq.topic-name}")
    public void receiveTopicMsg(String text) {
        System.out.println("topic: " + text);
    }
}
